package mark.tom.pistols.algorithm;

import java.util.Map;

import mark.tom.pistols.algorithm.generator.AESKeyGenerator;
import mark.tom.pistols.algorithm.generator.DESKeyGenerator;
import mark.tom.pistols.algorithm.generator.RSAKeyGenerator;

final class Creator {

    public static void main(String[] args) {
        try {
            System.out.println("###################RSA##########################");
            Map<String, Object> keyMap;
            keyMap = RSAKeyGenerator.getRSAKeyMap();
            String publicKey = RSAKeyGenerator.getPublicKey(keyMap);
            System.out.println("Public Key :");
            System.out.println(publicKey);
            System.out.println("\n");
            String privateKey = RSAKeyGenerator.getPrivateKey(keyMap);
            System.out.println("Private Key :");
            System.out.println(privateKey);
            System.out.println("###################RSA##########################");
        } catch (Exception e) {
            e.printStackTrace();
        }

        try {
            System.out.println("###################AES##########################");
            System.out.println("Default Key :");
            System.out.println(AESKeyGenerator.getKeyByDefault());
            System.out.println("\n");
            System.out.println("Password Key :");
            System.out.println(AESKeyGenerator.getKeyByPassword("tomshen"));
            System.out.println("###################AES##########################");
        } catch (Exception e) {
            e.printStackTrace();
        }

        try {
            System.out.println("###################DES##########################");
            System.out.println("Default Key :");
            System.out.println(DESKeyGenerator.getKeyByDefault());
            System.out.println("\n");
            System.out.println("Password Key :");
            System.out.println(DESKeyGenerator.getKeyByPassword("tomshen"));
            System.out.println("###################DES##########################");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
